import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login'
import Main from '../views/Main'
import MemberList from '../views/Member/MemberList'
import MemberLevel from '../views/Member/MemberLevel'
import NotFound from '../views/NotFound'

export default new Router({
  mode:'history',
  routes:[
    {
      path:'/',
      redirect:'/login'
    },
    {
    path:'/login',
    name:'Login',
    component:Login
    },
    {
    path:'/logout',
    redirect:'/login'
    },
  {
    path:'/main/:name',
    name:'Main',
    component:Main,
    children:[
      {
        path:'/member/list',
        name:'MemberList',
        component:MemberList
      },
      {
        path:'/member/level/:id',
        name:'MemberLevel',
        component:MemberLevel,
        props:true
      }
    ]
  },
  {
    path:'/goMain/:name',
    redirect:'/main/:name'
  },
  {
    path:'*',
    component:NotFound
  }
  ]
})
